package com.gilight.base.admin.order;



import com.gilight.base.base.exception.AdminServiceException;
import com.gilight.base.base.exception.ServiceException;
import com.gilight.base.dto.order.OrderDTO;
import com.gilight.base.dto.order.OrderStatisticsByDayDTO;
import com.gilight.base.dto.order.OrderStatisticsDTO;
import com.gilight.base.model.Page;
import com.gilight.base.model.order.OrderDO;

import java.util.List;

/**管理员订单服务
 * 订单管理
 * Created by rize on 2019/7/10.
 */
public interface AdminOrderService {

    /**
     *
     * @param page    订单页码
     * @param limit   页码长度
     * @param status  订单状态
     * @param orderNo 订单号
     * @param adminId
     * @param zzjgId
     * @return
     * @throws ServiceException
     */
    public Page<OrderDO> list(
            Integer page,
            Integer limit,
            Integer status,
            String orderNo,
            Long adminId, Long zzjgId,Long start,Long end) throws ServiceException;

    /**
     * 退款
     * @param orderNo
     * @param type        0.拒绝退款 1.同意退款
     * @param sum         退款金额
     * @param adminId
     * @param zzjgId
     * @return
     * @throws ServiceException
     */
    public String refund(
            String orderNo,
            Integer type,
            Integer sum,
            Long adminId, Long zzjgId) throws ServiceException;

    /**
     * 发货
     * @param orderNo   订单号
     * @param shipCode  承运商Code
     * @param shipNo    运单号
     * @param adminId
     * @param zzjgId
     * @return
     * @throws ServiceException
     */
    public String ship(
            String orderNo,
            String shipCode,
            String shipNo,
            Long adminId, Long zzjgId) throws ServiceException;

    /**详情
     *
     * @param orderNo 订单Id
     * @param adminId
     * @return
     * @throws ServiceException
     */
    public OrderDTO detail(
            Long orderNo,
            Long adminId) throws ServiceException;

    /**
     * 根据传入时间和订单状态查询订单信息
     * @param gmtStart  查询开始时间
     * @param gmtEnd    查询结束时间
     * @param status    订单状态
     * @param adminId
     * @param zzjgId
     * @return
     * @throws ServiceException
     */
    public List<OrderDTO> queryToExcel(
            Long gmtStart,
            Long gmtEnd,
            Integer status,
            Long adminId, Long zzjgId) throws ServiceException;

    /**
     * 编辑管理员备注
     * @param orderId  订单Id
     * @param level    备注等级
     * @param mono     备注
     * @param adminId
     * @return
     * @throws ServiceException
     */
    public String editAdminMono(
            Long orderId,
            Integer level,
            String mono,
            Long adminId) throws ServiceException;

    /**
     * 订单统计
     * @param gmtStart 查询开始时间
     * @param gmtEnd   查询结束时间
     * @param adminId
     * @param zzjgId
     * @return
     * @throws ServiceException
     */
    public List<OrderStatisticsDTO> statistics(
            Long gmtStart,
            Long gmtEnd,
            Long adminId, Long zzjgId) throws ServiceException;


    public List<OrderStatisticsByDayDTO>  statisticsByDay(Long gmtStart, Long gmtEnd, Long adminId, Long zzjgId) throws AdminServiceException;

    Object statisticsByDayWx(Long gmtStart, Long gmtEnd, Long adminId, Long zzjgId) throws ServiceException;
}
